<template>
  <div>
    <!--<mt-field label="用户名" placeholder="请输入用户名" v-model="username">{{this.username}}</mt-field>-->
    <mt-field label="日期" placeholder="日期" type="date" v-model="time"></mt-field>
    <mt-field label="事件名称" placeholder="" type="textarea" rows="1" v-model="title"></mt-field>
    <mt-field label="事件信息" placeholder="" type="textarea" rows="5" v-model="introduction"></mt-field>
    <mt-button type="default" class="set-button1" @click="btnSubtext">提交</mt-button>
    <mt-button type="default" class="set-button2" @click="btnChange">重置</mt-button>
    <div>
      事件提交时间:{{time}}<br>
      事件名称:{{title}}<br>
      事件内容:{{introduction}}
    </div>
  </div>
</template>

<script>
  import { Button } from 'mint-ui';
  import { Field } from 'mint-ui';
  export default {
    name: "re-content",
    components:{
      MtField:Field,
      MtButton:Button
    },
    data:function () {
      return{
        time:null,
        introduction:'',
        title:'',
      }
    },
    methods:{
      btnChange:function () {
        this.time = null;
        this.introduction = '';
        this.title = '';
      },
      btnSubtext:function () {
        if(this.$store.state.stateNumber === true){
          console.log("recontent部分内容开始====================");
          this.$store.commit('btnChangeMsg',this.title,this.introduction,this.time);
          console.log("提交事件提醒成功");
          console.log("recontent部分内容结束====================")
        }
        else{
          console.log("提交事件提醒失败");
        }
  },
      getTitleInfo(){
        console.log(this.$store.state.MsgName);
        return this.$store.state.MsgName;
      },
      getMessageInfo(){
        console.log(this.$store.state.MsgContent);
        return this.$store.state.MsgContent;
      },
      getMsgDateTimeInfo(){
        console.log(this.$store.state.MsgDateTime);
        return this.$store.state.MsgDateTime;
      }
    }
  }
</script>

<style scoped>
  .set-button1{
    margin-top: 1rem;
    margin-left: 0rem;
    margin-right: 6.5rem;

  }
  .set-button1{
    margin-top: 1rem;
    margin-right: 3rem;
  }
</style>
